package com.donn.securitycontrolplatform.dangerousgood.controller;


import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.donn.securitycontrolplatform.common.Result;
import com.donn.securitycontrolplatform.dangerousgood.service.ITEquipmentStorageService;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 高压气瓶前端控制器
 * </p>
 *
 * @author zhenglx
 * @since 2022-07-08
 */
@RestController
@RequestMapping("/scp/api/storage")
@Tag(name = "Equipment-StorageController", description = "高压气瓶库存controller")
public class TEquipmentStorageController {

    @Autowired
    ITEquipmentStorageService equipmentStorageService;

    @ApiOperation(value = "高压气瓶一周出入库情况")
    @GetMapping("/storageinfo/lastweek/get")
    @ResponseBody
    public Result getLastweekStorageInfo() {
        return equipmentStorageService.getLastWeekStorageInfo();
    }


    @ApiOperation(value = "查询高压气瓶列表")
    @GetMapping("/list")
    @ResponseBody
    public Result list(Page page) {
        page.addOrder(OrderItem.desc("id"));
        return equipmentStorageService.selectEquipmentStorageList(page);
    }


}
